package com.dayu.finecomm.mongo.service;

import javax.annotation.Resource;

import org.bson.types.ObjectId;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;

import com.dayu.finecomm.mongo.pojo.Gateway;

/**
 * 智能网关service类
 * 
 * @author Chenjiawei
 *
 *         2017年7月11日
 */
@Service
public class GatewayService implements InitializingBean {

	@Resource
	MongoDAO dao;

	public void insert(Gateway gateway) {

		gateway.set_id(new ObjectId().toHexString());
		gateway.setTime((int) System.currentTimeMillis());

		dao.gateway.insert(gateway);
	}

	@Override
	public void afterPropertiesSet() throws Exception {
	}

}
